//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

package inet.greencloudsimulator;
import inet.node.inet.AdhocHost;
import inet.node.inet.StandardHost;
//
// TODO auto-generated type
//

import inet.greencloudsimulator.IUDPGreenCloudApp;

//
// IPv4 host with SCTP, TCP, UDP layers and applications.
// IP forwarding is disabled by default (see IPForward).
// - Can be connected via ethernet interface to other nodes using
//   the ethg gate. By default full-duplex connections are supported
//   only (twisted pair). Set **.eth[*].typename="EthernetInterface" for
//   a full/half-duplex CSMA/CD implementation (coaxial cable)
// - By default contains no wireless cards, however it can be configured
//   by the numRadios parameter. Wirless card type is configured by the
//   **.wlan[*].typename parameter. see:  inet.linklayer.ieee80211 or other
//   modules implementing ~IWirelessNic
// - Also external interfaces can be configured for HW in the loop simulation
//   using the numExtInterfaces parameter and setting the type using
//   **.ext[*].typename in the INI file. see: ~ExtInterface and ~IExternalNic
// - If wireless card is present, node mobility can be set using **.mobilityType
//   see: inet.mobility and ~IMobility
//
module myComputingNode extends StandardHost
{
    parameters:
        @display("i=device/pc2");
        bool eDVFS_enabled_ = default(true);
        int numGreenUdpApps = default(0);  // no of UDP apps. Specify the app types in INI file with udpApp[0..1].typename="UDPVideoStreamCli" syntax
        forwarding = default(false);
    submodules:
     //   udpApp[numUdpApps]: ComputingNode {
     //       parameters:
     //           @display("p=336,54,row");
    //    }

        greenApp[numGreenUdpApps]: <> like IUDPGreenCloudApp {
            parameters:
                @display("p=502,49,row");
        }
    connections allowunconnected:
        for i=0..numGreenUdpApps-1 {
            greenApp[i].socketOut --> at.in++;
            greenApp[i].socketIn <-- at.out++;
        }
}

